1. Field of the Invention
The present invention is related to processing systems and processors, and more specifically to techniques for disabling a hardware thread and indicating when shared resources for the thread will not impacted by the disabled thread while instructions are still pending for the disabled thread.
2. Description of Related Art
In simultaneous multi-threaded (SMT) processors, some hardware resources are shared by multiple hardware threads, and therefore the hardware threads can be impacted by other threads' actions on the shared resources. Hardware threads are separate streams of execution performed in pipelines of a process, in contrast to software threads, which may be executed in a single hardware thread or by multiple hardware threads and represent paths of execution of one or more programs.
Operating systems provide tools such as spinlocks and critical sections for preventing software threads from modifying shared resources, effectively disabling other software threads while the resource is being modified or read. Such tools are easily implemented in multiple software threads executing in a single hardware thread, as the execution paths can be immediately managed. However, there is not a similar technique for hardware threads. Hardware threads are generally independent. Therefore, in order to prevent a thread from impacting a shared resource in present hardware, the thread is typically completely disabled and flushed from the pipeline, along with a release of resources, including instruction queues and mapped registers.
Therefore, in present day systems, in order to ensure that resources shared by a thread that could otherwise be only temporarily halted, the thread must be completely disabled, the pipelines flushed and resources released. The time required to perform such operations is substantial and may have further impact on system performance, since any task that was assigned to the hardware thread being disabled must be re-assigned to another hardware thread.
It would therefore be desirable to provide an indication to other threads that a particular hardware thread has been disabled and shared resources are safe from actions of the particular thread. It would further be desirable to provide such an indication without completely flushing the particular hardware thread from a processor, by only temporarily disabling the particular hardware thread.